package com.blue.base.common.id;


/**
 * mybatis-plus内部的ID生成器
 * 高效GUID产生算法(sequence),基于Snowflake实现64位自增ID算法。
 * <p>优化开源项目 https://gitee.com/yu120/sequence</p>
 *
 * @author liulei
 * @version 1.0
 */
public class IDGenerator {
    /**
     * 主机和进程的机器码
     */
    private static Sequence WORKER = new Sequence(1);

    public static long getId() {
        return WORKER.nextId();
    }

    public static String getIdStr() {
        return String.valueOf(WORKER.nextId());
    }

}
